﻿<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ page import="nc.bs.ebvp.sourcingcoll.Constants"%>
<%
	String basePath = request.getContextPath();
	String fig = (String)request.getAttribute("fig");
	Map mapStatus = (Map)request.getAttribute(Constants.ID_PROJ_STEP_STATUS);
%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	</head>
	<body class="fullbody">
		<div class="context">
			<div class="position">
				<div class="tposi">
					当前位置：
					<a href="<%=basePath%>/infopub/pubmain"	class="linkstyle">首页</a> &nbsp;&gt;&gt;&nbsp;
					<a href="<%=basePath%>/sourcing/projlist" class="linkstyle">我的投标\谈判\询价</a> &nbsp;&gt;&gt;&nbsp;
					<a href="<%=basePath%>/sourcing/biddingprojlist" class="linkstyle">进行中的项目</a> &nbsp;&gt;&gt;&nbsp;
					<span class="curposition">${PURPROJECT_FORM.project_name}</span>
				</div>
			</div>
			<div class="margin8">
			</div>
			<div class="subpage_title">
				<div class="title_index">
					<img src="<%=basePath%>/images/common/dot03.gif" alt="" border="0" />
					&nbsp;${PURPROJECT_FORM.project_name}
				</div>
				<div class="rollback">
					<a href="<%=basePath%>/sourcing/biddingprojlist" class="linkstyle">&lt;&lt;&nbsp;返回进行中的项目</a>
				</div>
			</div>
			<div class="margin20">
			</div>
			<div class="bid">
				<div class="bidflow">
					<div class="spliter">
					</div>
					<div class="spliter">
					</div>
					<c:if test="${PROJ_STEP_LIST != null}">
						<c:forEach items="${PROJ_STEP_LIST}" var="projStep">
							<c:if test="${(projStep.step_type == '001' || projStep.step_type == '002' ||projStep.step_type == '003' || projStep.step_type == '004' || projStep.step_type == '0091' || projStep.step_type == '0092' || projStep.step_type == '0093' || projStep.step_type == '010') and projStep.is_first_step != 'true'}">
								<div class="flow_arrow">
									<img src="<%=basePath%>/images/common/arrow_down.png" alt="" />
								</div>
							</c:if>	
							<c:if test="${projStep.step_type == '001'}">
								<div class="flow">
									<table border="0" cellpadding="0" cellspacing="0"
										class="${projStep.css}"
									<c:if test="${projStep.step_status != '1'}">
										onclick="javascript:doReply('1','${projStep.pk_pur_project}','${projStep.pk_purproj_step}');"
									</c:if>
										>
										<tr>
											<td class="bgm" align="center">
												邀请公告应答
												<br />
												${projStep.op_ts}
											</td>
										</tr>
									</table>
								</div>
							</c:if>
							<c:if test="${projStep.step_type == '002'}">
								<div class="flow">
									<table border="0" cellpadding="0" cellspacing="0"
										class="${projStep.css}" 
									<c:if test="${projStep.step_status != '1'}">
										onclick="javascript:doReply('2','${projStep.pk_pur_project}','${projStep.pk_purproj_step}');"
									</c:if>
									>
										<tr>
											<td class="bgm" align="center">
												采购文件应答
												<br />
												${projStep.op_ts}
											</td>
										</tr>
									</table>
								</div>
							</c:if>
							<c:if test="${projStep.step_type == '003'}">
								<div class="flow">
									<table border="0" cellpadding="0" cellspacing="0"
										class="${projStep.css}"
									<c:if test="${projStep.step_status != '1'}">
										onclick="javascript:doReply('3','${projStep.pk_pur_project}','${projStep.pk_purproj_step}');"
									</c:if>
									>
										<tr>
											<td class="bgm" align="center">
												发布文件应答
												<br />
												${projStep.op_ts}
											</td>
										</tr>
									</table>
								</div>
							</c:if>
							<c:if test="${projStep.step_type == '004'}">
								<div class="flow">
									<table border="0" cellpadding="0" cellspacing="0"
										class="${projStep.css}"
									<c:if test="${projStep.step_status != '1'}">
										onclick="javascript:doReply('4','${projStep.pk_pur_project}','${projStep.pk_purproj_step}');"
									</c:if>
									>
										<tr>
											<td class="bgm" align="center">
												确认开标登记表
												<br />
												${projStep.op_ts}
											</td>
										</tr>
									</table>
								</div>
							</c:if>
							<c:if test="${projStep.step_type == '0091'}">
								<div class="flow">
									<table border="0" cellpadding="0" cellspacing="0"
										class="${projStep.css}"
									<c:if test="${projStep.step_status != '1'}">
										onclick="javascript:doReply('91','${projStep.pk_pur_project}','${projStep.pk_purproj_step}');"
									</c:if>
									>
										<tr>
											<td class="bgm" align="center">
												确认配置单
												<br />
												${projStep.op_ts}
											</td>
										</tr>
									</table>
								</div>
							</c:if>
							<c:if test="${projStep.step_type == '0092'}">
								<div class="flow">
									<table border="0" cellpadding="0" cellspacing="0"
										class="${projStep.css}"
									<c:if test="${projStep.step_status != '1'}">
										onclick="javascript:doReply('92','${projStep.pk_pur_project}','${projStep.pk_purproj_step}');"
									</c:if>
									>
										<tr>
											<td class="bgm" align="center">
												在线竞价
												<br />
												${projStep.op_ts}
											</td>
										</tr>
									</table>
								</div>
							</c:if>
							<c:if test="${projStep.step_type == '0093'}">
								<div class="flow">
									<table border="0" cellpadding="0" cellspacing="0"
										class="${projStep.css}"
									<c:if test="${projStep.step_status != '1'}">
										onclick="javascript:doReply('93','${projStep.pk_pur_project}','${projStep.pk_purproj_step}');"
									</c:if>
									>
										<tr>
											<td class="bgm" align="center">
												竞价结果确认
												<br />
												${projStep.op_ts}
											</td>
										</tr>
									</table>
								</div>
							</c:if>
							<c:if test="${projStep.step_type == '010'}">
								<div class="flow">
									<table border="0" cellpadding="0" cellspacing="0"
										class="${projStep.css}"
									<c:if test="${projStep.step_status != '1'}">
										onclick="javascript:doReply('10','${projStep.pk_pur_project}','${projStep.pk_purproj_step}');"
									</c:if>
									>
										<tr>
											<td class="bgm" align="center">
												中标结果确认
												<br />
												${projStep.op_ts}
											</td>
										</tr>
									</table>
								</div>
							</c:if>
						</c:forEach>
					</c:if>
					<div class="spliter">
					</div>
					<div class="spliter">
					</div>
					<div class="flow_sample">
						注：&nbsp;&nbsp;
						<img src="<%=basePath%>/images/flow/flowtype3.gif" alt="后续流程" />
						未执行步骤
						<img src="<%=basePath%>/images/flow/flowtype2.gif" alt="待办事项" />
						执行中步骤&nbsp;&nbsp;
						<img src="<%=basePath%>/images/flow/flowtype1.gif" alt="已完成步骤" />
						已完成步骤&nbsp;&nbsp;
					</div>
					<div class="spliter">
					</div>
					<div class="spliter">
					</div>
				</div>
				<div class="bidflow_content">
					<div class="bidflow_content_text">
						<div class="bid_name">
							项目名称：
							<b>${PURPROJECT_FORM.project_name}</b>
						</div>
						<div class="bid_name">
							项目编号： ${PURPROJECT_FORM.billno}
						</div>
						<div class="bid_name">
							发起日期：${PURPROJECT_FORM.begin_exec_date}
						</div>
						<div class="margin50">
						</div>
					</div>
				</div>
			</div>
		</div>
		<script language="javascript">
		function doReply(type,pkProj,pkProjStep){
			var url = null;
			var fig = "<%=fig%>";
			if(type == "1"){
				url = "<%=basePath%>/sourcing/biddingprojlist/releaseinviteinfo?pkProj="+pkProj+"&pkProjStep="+pkProjStep;
			}else if(type == "2" || type == "3"){
				var resValue = isNeedReply(pkProjStep);
				if(null != resValue && "N" === resValue){
					alert("不需要对该环节进行应答！");
					return;
					}
				url = "<%=basePath%>/sourcing/biddingprojlist/releasepurfileinfo?pkProj="+pkProj+"&pkProjStep="+pkProjStep+"&type="+type;
			}else if(type == "4"){
				url = "<%=basePath%>/sourcing/biddingprojlist/reginfo?pkProj="+pkProj+"&pkProjStep="+pkProjStep;
			}else if(type == "91"){
				url = "<%=basePath%>/sourcing/biddingprojlist/tpltinfo?pkProj="+pkProj+"&pkProjStep="+pkProjStep;
			}else if(type == "92"){
				url = "<%=basePath%>/sourcingcoll/quotelogin.jsp?pkProj="+pkProj+"&pkProjStep="+pkProjStep;
			}else if(type == "93"){
				url = "<%=basePath%>/sourcing/biddingprojlist/getoldquote?projPk="+pkProj+"&pkProjStep="+pkProjStep+"&quote_index=0&isconfirm=1";
			}else if(type == "10"){
				url = "<%=basePath%>/sourcing/projexec/resultinform?pkProj="+pkProj+"&pkProjStep="+pkProjStep+"&fig="+fig;
			}
			document.location.href = url;
		}

		//发布类环节是否需要应答
		function isNeedReply(pkProjStep){     
			var postData ="pkProjStep="+pkProjStep;
			var reValue;
			jQuery.ajax({ 
                type: "POST", 
                async:false,
                url:"<%=request.getContextPath()%>/sourcing/biddingprojlist/validReply", 
                data:postData, 
                dataType:"text",
                complete:function( res, status ) {
    				// If successful,
    				if ( status === "success" || status === "notmodified" ) {
    					reValue =  res.responseText;
    				}
                }
            })
            return reValue;
			}
		</script>
	</body>
</html>
